package cn.cheln.explorer.actions;

import android.app.Activity;
import android.app.ProgressDialog;
import android.content.ActivityNotFoundException;
import android.content.Context;
import android.content.DialogInterface;
import android.content.DialogInterface.OnClickListener;
import android.content.Intent;
import android.net.Uri;
import android.os.Handler;
import android.os.Looper;
import android.os.Message;
import android.util.Log;
import android.widget.Toast;
import cn.cheln.explorer.beans.FileInfo;
import cn.cheln.explorer.beans.FileInfoUtil;
import cn.cheln.explorer.beans.FileUtil;
import cn.cheln.explorer.config.Config;
import cn.cheln.explorer.config.Constants;
import cn.cheln.explorer.ds.database.copersynch.DatasrcDelete;
import cn.cheln.explorer.ds.database.copersynch.DatasrcPaste;
import cn.cheln.explorer.util.DialogUtil;
import cn.cheln.explorer.util.DialogUtil.DialogAbstract;
import cn.cheln.explorer.util.ReadSystemMemory;
import cn.cheln.support.images.MimeTypeMap;
import cn.cheln.support.log.Logs;
import cn.cheln.support.mobile.sdcard.SDcardChecker;
import com.direction.hold.ui.CommonActivity;
import com.direction.hold.ui.CountActivity;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

public class OperationUtil
{
  private static final int COPY_BUFFER_SIZE = 32768;
  public static String COPY_OF;
  public static final int OPER_TYPE_COPY = 1;
  public static final int OPER_TYPE_CUT = 0;
  public static final int OPER_TYPE_DEL = 2;
  public static final int OPER_TYPE_MOVE_PRIVACY = 3;
  public static final int STATUS_BROWSE = 2;
  public static final int STATUS_CUT_COPY = 1;
  public static final int STATUS_SELECT = 3;
  private static int copied;
  public static List<FileInfo> cutDirectlyMovedDir;
  public static boolean duplicatedDialogFlag;
  public static Integer mOperationState;
  public static Map<FileInfo, FileInfo> operMatcher;
  private static int operType;
  public static ProgressDialog operatingDialog;
  public static boolean operationRunnableOver;
  public static boolean sdcardFullMarked;
  public static CommonActivity selectedActivity;
  public static List<FileInfo> selectedEntities = new ArrayList();
  public int actualDuplicated;
  private DialogInterface.OnClickListener cancelClickListener = new CancelOperationClickListener(???);
  public Context context;
  private DialogInterface.OnClickListener delCancelClickListener = new DialogInterface.OnClickListener()
  {
    public void onClick(DialogInterface paramDialogInterface, int paramInt)
    {
      paramDialogInterface.cancel();
      paramDialogInterface.dismiss();
    }
  };
  private String destination;
  public Map<String, Boolean> duplicated = new HashMap();
  private File file;
  Message mess;
  public String name;
  boolean nameConflictFlag = true;
  public String newpath;
  private DialogInterface.OnClickListener operClickListener = new PerformOperationClickListener(???);
  public List<FileInfo> pasteOperEntities = new ArrayList();
  public Thread thread;

  static
  {
    cutDirectlyMovedDir = new ArrayList();
    mOperationState = Integer.valueOf(2);
    operMatcher = new HashMap();
    duplicatedDialogFlag = false;
    operType = 3;
  }

  private void accountDuplicated(Context paramContext, int paramInt1, int paramInt2, int paramInt3)
  {
    String[] arrayOfString = new File(this.destination).list();
    List localList = initFileList(selectedEntities);
    File localFile = new File(this.destination);
    if (arrayOfString == null);
    for (Object localObject = new ArrayList(); ; localObject = Arrays.asList(arrayOfString))
    {
      HashMap localHashMap = new HashMap();
      this.duplicated = localHashMap;
      accountDuplicated(localList, localFile, (List)localObject, localHashMap);
      String str = this.duplicated.size();
      if (this.duplicated.isEmpty())
        break;
      DialogUtil.DialogAbstract localDialogAbstract = new DialogUtil.DialogAbstract();
      localDialogAbstract.context = paramContext;
      localDialogAbstract.title = paramContext.getString(paramInt1);
      localDialogAbstract.message = paramContext.getString(2131034170, new Object[] { str });
      localDialogAbstract.positiveButtonText = paramContext.getString(2131034171);
      localDialogAbstract.negativeButtonText = paramContext.getString(paramInt2);
      localDialogAbstract.positiveButtonClickListener = this.operClickListener;
      localDialogAbstract.negativeButtonClickListener = this.cancelClickListener;
      duplicatedDialogFlag = true;
      DialogUtil.showChoiceDialog(localDialogAbstract);
      return;
    }
    Logs.i("", "============= dialog 's context " + paramContext);
    this.thread.start();
    operatingDialog.show();
  }

  private void accountDuplicated(List<File> paramList, File paramFile, List<String> paramList1, Map<String, Boolean> paramMap)
  {
    label13: File localFile1;
    File localFile2;
    if (paramList == null)
      return;
    Iterator localIterator = paramList.iterator();
    while (true)
    {
      if (localIterator.hasNext());
      localFile1 = (File)localIterator.next();
      if (localFile1 == null)
        continue;
      this.newpath = paramFile + "/" + localFile1.getName();
      localFile2 = new File(this.newpath);
      if ((!(paramList1.contains(localFile1.getName()))) || (!(localFile2.exists())) || (localFile1.isHidden()))
        continue;
      if (!(localFile2.isFile()))
        break;
      if (localFile1.getParent().equals(paramFile.getAbsolutePath()))
        continue;
      paramMap.put(this.newpath, Boolean.valueOf(false));
    }
    String[] arrayOfString = localFile2.list();
    List localList = Arrays.asList(localFile1.listFiles());
    if (arrayOfString != null);
    for (Object localObject = Arrays.asList(arrayOfString); ; localObject = new ArrayList())
    {
      accountDuplicated(localList, localFile2, (List)localObject, paramMap);
      break label13:
    }
  }

  public static void copy(File paramFile1, File paramFile2)
  {
    try
    {
      FileInputStream localFileInputStream = new FileInputStream(paramFile1);
      FileOutputStream localFileOutputStream = new FileOutputStream(paramFile2);
      byte[] arrayOfByte = new byte[32768];
      int i = localFileInputStream.read(arrayOfByte);
      if (i <= 0)
      {
        localFileOutputStream.close();
        localFileInputStream.close();
        return;
      }
      localFileOutputStream.write(arrayOfByte, 0, i);
    }
    catch (Exception localException)
    {
    }
  }

  public static void dataClear()
  {
    if (selectedEntities.isEmpty())
      return;
    selectedEntities.clear();
    copied = 0;
    sdcardFullMarked = false;
  }

  public static int getOperType()
  {
    return operType;
  }

  public static void initStrCnst(Context paramContext)
  {
    COPY_OF = paramContext.getString(2131034180);
  }

  private boolean move(File paramFile1, File paramFile2)
  {
    return paramFile1.renameTo(paramFile2);
  }

  public static void openFile(String paramString1, Context paramContext, String paramString2)
  {
    openFile(paramString1, paramContext, paramString2, true);
  }

  public static void openFile(String paramString1, Context paramContext, String paramString2, boolean paramBoolean)
  {
    File localFile = new File(paramString1);
    if (!(localFile.exists()));
    do
    {
      return;
      Intent localIntent = new Intent("android.intent.action.VIEW");
      Uri localUri = Uri.fromFile(localFile);
      if (paramString2 == null);
      for (String str = (String)MimeTypeMap.getSingleton().getExtensionToMimeTypeMap().get(FileUtil.getRealLowerCaseExtension(localFile.getName().toString())); str == null; str = paramString2)
      {
        Toast.makeText(paramContext, 2131034176, 0).show();
        return;
      }
      if (str.startsWith("package"))
        str = "application" + str.substring(str.indexOf("/"));
      Logs.i("type", "===" + str);
      if (str == null)
        str = "*/*";
      localIntent.setDataAndType(localUri, str);
      try
      {
        paramContext.startActivity(localIntent);
        return;
      }
      catch (ActivityNotFoundException localActivityNotFoundException)
      {
      }
    }
    while (!(paramBoolean));
    Toast.makeText(paramContext, 2131034176, 1).show();
  }

  private void operate(int paramInt, Context paramContext)
  {
    switch (paramInt)
    {
    default:
    case 2:
    case 0:
    case 1:
    case 3:
    }
    while (true)
    {
      updateEndOnFiles(getOperType());
      Logs.i("toSelectedString", "duplicated --" + this.duplicated.size());
      return;
      int i = -1 + selectedEntities.size();
      label82: if ((i < 0) || (selectedEntities.size() < i))
        continue;
      FileInfo localFileInfo = (FileInfo)selectedEntities.get(i);
      if (localFileInfo == null);
      while (true)
      {
        --i;
        break label82:
        this.file = localFileInfo.getFile();
        recursiveDelete(this.file);
      }
      recursiveCut(initPathList(selectedEntities), this.destination);
      continue;
      recursiveCopy(selectedEntities, this.destination, true);
      continue;
      moveInPrivacy(initPathList(selectedEntities), this.destination, paramContext);
    }
  }

  private void recursiveCopy(List<FileInfo> paramList, String paramString, boolean paramBoolean)
  {
    Object localObject;
    Iterator localIterator;
    String[] arrayOfString = new File(paramString).list();
    if (arrayOfString == null)
    {
      localObject = new ArrayList();
      localIterator = paramList.iterator();
    }
    while (true)
    {
      label190: StringBuilder localStringBuilder;
      if (!(localIterator.hasNext()))
      {
        return;
        localObject = Arrays.asList(arrayOfString);
      }
      FileInfo localFileInfo = (FileInfo)localIterator.next();
      Logs.i("", "========== src getPath" + localFileInfo.getPath());
      if (localFileInfo == null)
        continue;
      String str = "";
      if (localFileInfo.getFile().getParent().equals(paramString))
        str = COPY_OF;
      File localFile = new File(paramString + "/" + str + localFileInfo.getName());
      Logs.i("", "========== target path " + localFile.getAbsolutePath());
      if (!(localFile.exists()))
      {
        Logs.i("copy", " src " + localFileInfo.getFile().getAbsolutePath() + " target " + localFile.getAbsolutePath());
        if (!(localFileInfo.getFile().isFile()))
          break label624;
        Logs.i("==Read ReadSystemMemory.getAvailableInternalMemorySize(): " + ReadSystemMemory.getAvailableInternalMemorySize());
        Logs.i("==Read src.length(): " + localFileInfo.getFile().length());
        localStringBuilder = new StringBuilder("==Read boolean ");
        if (ReadSystemMemory.getAvailableExternalMemorySize().longValue() >= localFileInfo.getFile().length())
          break label511;
      }
      for (boolean bool1 = true; ; bool1 = false)
      {
        Logs.i(bool1);
        if (ReadSystemMemory.getAvailableExternalMemorySize().longValue() >= localFileInfo.getFile().length())
          break;
        if (!(sdcardFullMarked));
        Context localContext1 = this.context;
        Context localContext2 = this.context;
        Object[] arrayOfObject = new Object[1];
        arrayOfObject[0] = copied;
        Toast.makeText(localContext1, localContext2.getString(2131034240, arrayOfObject), 1).show();
        sdcardFullMarked = true;
        return;
        if (!(str.equals("")));
        str = str + COPY_OF;
        localFile = new File(paramString + "/" + str + localFileInfo.getName());
        label511: break label190:
      }
      boolean bool2 = ((List)localObject).contains(localFileInfo.getName());
      Boolean localBoolean2 = null;
      if (bool2)
      {
        boolean bool3 = localFile.exists();
        localBoolean2 = null;
        if (bool3)
        {
          localFile.delete();
          localBoolean2 = Boolean.valueOf(true);
        }
      }
      copy(localFileInfo.getFile(), localFile);
      try
      {
        operMatcher.put(localFileInfo, FileInfo.hasFileInfo(localFileInfo.getClass(), localFile, this.context, localBoolean2));
        label689: label603: label624: copied = 1 + copied;
      }
      catch (Exception localException2)
      {
        while (true)
        {
          localException2.printStackTrace();
          break label603:
          Boolean localBoolean1 = Boolean.valueOf(true);
          if ((!(localFile.exists())) || (((List)localObject).contains(localFileInfo.getName())))
          {
            localFile.mkdir();
            localBoolean1 = null;
          }
          try
          {
            operMatcher.put(localFileInfo, FileInfo.hasFileInfo(localFileInfo.getClass(), localFile, this.context, localBoolean1));
            Log.i("file", "-----------" + localFileInfo.getFile().getAbsolutePath());
            File[] arrayOfFile = localFileInfo.getFile().listFiles();
            if (arrayOfFile != null);
            ArrayList localArrayList = new ArrayList();
            FileInfoUtil.getFileInfos(localArrayList, FileInfo.class, arrayOfFile, this.context, null);
            recursiveCopy(localArrayList, localFile.getAbsolutePath(), false);
          }
          catch (Exception localException1)
          {
            localException1.printStackTrace();
            break label689:
          }
        }
      }
    }
  }

  private void recursiveCut(List<String> paramList, String paramString)
  {
    Iterator localIterator = paramList.iterator();
    while (true)
    {
      if (!(localIterator.hasNext()))
        return;
      this.file = new File((String)localIterator.next());
      if (this.file.getParent().equals(paramString))
        Logs.i("", "needn't move");
      File localFile = new File(paramString + "/" + this.file.getName());
      recursiveMove(this.file, localFile, true);
    }
  }

  public static Boolean renameFileOrFolder(File paramFile, String paramString, CommonActivity paramCommonActivity)
  {
    File localFile = new File(FileUtil.getPathWithoutFilename(paramFile.getParentFile()) + "/" + paramString);
    if (localFile.getName().equals(paramFile.getName()))
    {
      Toast.makeText(paramCommonActivity, 2131034196, 0).show();
      return null;
    }
    if (localFile.exists())
    {
      Toast.makeText(paramCommonActivity, 2131034175, 0).show();
      return null;
    }
    return Boolean.valueOf(paramFile.renameTo(localFile));
  }

  public static void setOperType(int paramInt)
  {
    operType = paramInt;
  }

  public static ArrayList<String> toListPath(Context paramContext)
  {
    ArrayList localArrayList = new ArrayList();
    Iterator localIterator = selectedEntities.iterator();
    while (true)
    {
      if (!(localIterator.hasNext()))
        return localArrayList;
      localArrayList.add(((FileInfo)localIterator.next()).getPath());
    }
  }

  private void updateEndOnFiles(int paramInt)
  {
    new Thread(paramInt)
    {
      public void run()
      {
        super.run();
        switch (this.val$operType)
        {
        default:
        case 2:
        case 0:
        case 1:
        case 3:
        }
        while (true)
        {
          OperationUtil.this.notifyFinished(true);
          return;
          OperationUtil.this.updateDelOnCategory();
          continue;
          OperationUtil.this.updateCutCopyOnFiles();
          continue;
          CommonActivity.refreshCountActivity();
        }
      }
    }
    .start();
  }

  public void addOperationTarget(FileInfo paramFileInfo)
  {
    if (selectedEntities.contains(paramFileInfo))
      return;
    selectedEntities.add(paramFileInfo);
  }

  public void composeOpertaingingDialog(Context paramContext)
  {
    int i = -1;
    switch (operType)
    {
    default:
    case 2:
    case 1:
    case 0:
    case 3:
    }
    while (operatingDialog == null)
    {
      operatingDialog = new ProgressDialog((Activity)paramContext);
      operatingDialog.setMessage(paramContext.getString(i));
      operatingDialog.setCancelable(false);
      operatingDialog.setIndeterminate(true);
      return;
      i = 2131034167;
      continue;
      i = 2131034165;
      continue;
      i = 2131034166;
      continue;
      i = 2131034205;
    }
    operatingDialog.setMessage(paramContext.getString(i));
  }

  public String getDestination()
  {
    return this.destination;
  }

  public List<FileInfo> getOperationTargets()
  {
    return selectedEntities;
  }

  public List<File> initFileList(List<FileInfo> paramList)
  {
    ArrayList localArrayList = new ArrayList();
    Iterator localIterator = paramList.iterator();
    while (true)
    {
      if (!(localIterator.hasNext()))
        return localArrayList;
      localArrayList.add(new File(((FileInfo)localIterator.next()).getPath()));
    }
  }

  public List<String> initPathList(List<FileInfo> paramList)
  {
    ArrayList localArrayList = new ArrayList();
    Iterator localIterator = paramList.iterator();
    while (true)
    {
      if (!(localIterator.hasNext()))
        return localArrayList;
      localArrayList.add(((FileInfo)localIterator.next()).getPath());
    }
  }

  public void invokeOperation(int paramInt, Context paramContext)
  {
    label89: String str;
    int i;
    operType = paramInt;
    this.context = paramContext;
    composeOpertaingingDialog(this.context);
    this.thread = new Thread(new OperationRunnable(paramContext, this));
    if (operType == 2)
      if (selectedEntities.size() == 1)
      {
        Object[] arrayOfObject = new Object[1];
        if (((FileInfo)selectedEntities.get(0)).isDir.booleanValue())
        {
          i = 2131034288;
          arrayOfObject[0] = paramContext.getString(i);
          str = paramContext.getString(2131034161, arrayOfObject);
          label109: DialogUtil.DialogAbstract localDialogAbstract = new DialogUtil.DialogAbstract();
          localDialogAbstract.context = paramContext;
          localDialogAbstract.title = paramContext.getString(2131034128);
          localDialogAbstract.message = str;
          localDialogAbstract.positiveButtonText = paramContext.getString(2131034163);
          localDialogAbstract.negativeButtonText = paramContext.getString(2131034164);
          localDialogAbstract.positiveButtonClickListener = this.operClickListener;
          localDialogAbstract.negativeButtonClickListener = this.delCancelClickListener;
          DialogUtil.showChoiceDialog(localDialogAbstract);
        }
      }
    do
    {
      return;
      i = 2131034289;
      break label89:
      str = paramContext.getString(2131034162);
      break label109:
      if (operType == 1)
      {
        accountDuplicated(paramContext, 2131034168, 2131034172, 2131034129);
        return;
      }
      if (operType != 0)
        continue;
      accountDuplicated(paramContext, 2131034169, 2131034173, 2131034127);
      return;
    }
    while (operType != 3);
    accountDuplicated(paramContext, 2131034169, 2131034203, 2131034202);
  }

  public void invokeOperation(Context paramContext)
  {
    invokeOperation(operType, paramContext);
  }

  public void moveInPrivacy(List<String> paramList, String paramString, Context paramContext)
  {
    recursiveCut(paramList, paramString);
    ((CommonActivity)paramContext).updateDelOnCategory4Privacy();
  }

  public void multipleSend(Context paramContext)
  {
    UriAbsPathFilter localUriAbsPathFilter1;
    Iterator localIterator;
    Intent localIntent;
    String str = ((CommonActivity)paramContext).prepareMime();
    str.equals("apk");
    ArrayList localArrayList = new ArrayList();
    try
    {
      Integer[] arrayOfInteger = new Integer[2];
      arrayOfInteger[0] = Integer.valueOf(4);
      arrayOfInteger[1] = Integer.valueOf(Config.getHiddenOption(((CommonActivity)paramContext).isHiddenFileShow()));
      UriAbsPathFilter localUriAbsPathFilter2 = new UriAbsPathFilter(arrayOfInteger, Constants.HIDDEN_EXCLUDED, Constants.HIDDEN_INCLUDED, localArrayList);
      localUriAbsPathFilter1 = localUriAbsPathFilter2;
      label79: localIterator = selectedEntities.iterator();
      label89: if (localIterator.hasNext())
        break label194;
      localIntent = new Intent("android.intent.action.SEND_MULTIPLE");
      if (localArrayList.size() <= 1)
        break label249;
      localIntent.putExtra("com.lewa.filemgr.SEND_FLAG", 2);
      localIntent.setType(str);
      localIntent.putParcelableArrayListExtra("android.intent.extra.STREAM", localArrayList);
      paramContext.startActivity(Intent.createChooser(localIntent, paramContext.getString(2131034136)));
      ((CommonActivity)paramContext).makeSelectAll(false, true);
      ((CommonActivity)paramContext).treatBottmBar();
      label194: label249: return;
    }
    catch (Exception localException)
    {
      localException.printStackTrace();
      localUriAbsPathFilter1 = null;
      break label79:
      FileInfo localFileInfo = (FileInfo)localIterator.next();
      File localFile = localFileInfo.getFile();
      if (localFile.isDirectory())
        localFile.listFiles(localUriAbsPathFilter1);
      localArrayList.add(Uri.fromFile(localFileInfo.getFile()));
      break label89:
      if (localArrayList.size() == 1);
      localIntent.putExtra("com.lewa.filemgr.SEND_FLAG", 1);
    }
  }

  public void notifyFinished()
  {
    notifyFinished(false);
  }

  public void notifyFinished(boolean paramBoolean)
  {
    if ((!(paramBoolean)) && (this.mess != null));
    do
    {
      return;
      this.mess = new Message();
      this.mess.what = 0;
      this.mess.obj = operatingDialog;
      ((CommonActivity)this.context).handler.sendMessage(this.mess);
    }
    while (!(paramBoolean));
    this.mess = null;
  }

  public void operate()
  {
    Log.i("---", "---123" + operType + " " + this.context);
    operate(operType, this.context);
  }

  public boolean recursiveDelete(File paramFile)
  {
    File[] arrayOfFile;
    int i;
    if (paramFile.isDirectory())
    {
      arrayOfFile = paramFile.listFiles();
      operMatcher.put(new FileInfo(paramFile, this.context), null);
      if (arrayOfFile != null)
      {
        i = 0;
        label43: if (i < arrayOfFile.length)
          break label58;
      }
    }
    while (true)
    {
      paramFile.delete();
      return false;
      label58: recursiveDelete(arrayOfFile[i]);
      ++i;
      break label43:
      operMatcher.put(new FileInfo(paramFile, this.context), null);
    }
  }

  public boolean recursiveMove(File paramFile1, File paramFile2, boolean paramBoolean)
  {
    if (paramFile1.isDirectory())
    {
      int i;
      if (!(paramFile2.exists()))
        paramFile2.mkdirs();
      operMatcher.put(new FileInfo(paramFile1, this.context), new FileInfo(paramFile2, this.context));
      File[] arrayOfFile = paramFile1.listFiles();
      if (arrayOfFile != null)
        i = arrayOfFile.length;
      for (int j = 0; ; ++j)
      {
        if (j >= i)
        {
          paramFile1.delete();
          return false;
        }
        File localFile = arrayOfFile[j];
        recursiveMove(localFile, FileUtil.reaplcePath(localFile, paramFile2), false);
      }
    }
    FileInfo localFileInfo = new FileInfo(paramFile2, this.context);
    if (paramFile2.exists())
    {
      paramFile2.delete();
      this.actualDuplicated = (1 + this.actualDuplicated);
      localFileInfo.overrideFlag = Boolean.valueOf(true);
    }
    operMatcher.put(new FileInfo(paramFile1, this.context), localFileInfo);
    boolean bool = move(paramFile1, localFileInfo.getFile());
    Logs.i("", "src ---------- " + paramFile1.getAbsolutePath() + "-----------" + paramFile2.getAbsolutePath() + "-----------" + bool);
    return bool;
  }

  public <T extends FileInfo> void removeOperationTarget(T paramT)
  {
    if (!(selectedEntities.contains(paramT)))
      return;
    selectedEntities.remove(paramT);
  }

  public void setCommand(int paramInt)
  {
    operType = paramInt;
  }

  public void setDestination(String paramString)
  {
    this.destination = paramString;
  }

  public int tackleNewFolderText(List<FileInfo> paramList, String paramString)
  {
    Pattern localPattern = Pattern.compile(paramString + "[\\s]*\\([\\d]+\\)");
    Integer localInteger1 = Integer.valueOf(0);
    Iterator localIterator = paramList.iterator();
    while (true)
    {
      if (!(localIterator.hasNext()))
        return localInteger1.intValue();
      FileInfo localFileInfo = (FileInfo)localIterator.next();
      if (!(localPattern.matcher(localFileInfo.getName()).matches()))
        continue;
      Logs.i("", "========== tt" + localFileInfo.getName());
      Integer localInteger2 = Integer.valueOf(Integer.parseInt(localFileInfo.getName().split("\\(")[1].split("\\)")[0]));
      localInteger1 = Integer.valueOf(Math.max(localInteger1.intValue(), localInteger2.intValue()));
    }
  }

  public void updateCutCopyOnFiles()
  {
    Iterator localIterator = new HashSet(operMatcher.entrySet()).iterator();
    while (true)
    {
      if (!(localIterator.hasNext()))
        return;
      Map.Entry localEntry = (Map.Entry)localIterator.next();
      FileInfo localFileInfo1 = (FileInfo)localEntry.getKey();
      FileInfo localFileInfo2 = (FileInfo)localEntry.getValue();
      DatasrcPaste.updateCutCopyOnSingleFile(localFileInfo2, localFileInfo2, localFileInfo1, this.context);
    }
  }

  public void updateDelOnCategory()
  {
    Iterator localIterator = new HashSet(operMatcher.keySet()).iterator();
    while (true)
    {
      if (!(localIterator.hasNext()))
        return;
      DatasrcDelete.recursiveUpdateDel((FileInfo)localIterator.next(), this.context);
    }
  }

  public void updateDelOnCategory4Privacy()
  {
    Iterator localIterator = operMatcher.keySet().iterator();
    while (true)
    {
      if (!(localIterator.hasNext()))
        return;
      DatasrcDelete.recursiveUpdateDel((FileInfo)localIterator.next(), this.context);
    }
  }

  private class CancelOperationClickListener
    implements DialogInterface.OnClickListener
  {
    OperationUtil oper;

    public CancelOperationClickListener(OperationUtil paramOperationUtil)
    {
      this.oper = paramOperationUtil;
    }

    public void onClick(DialogInterface paramDialogInterface, int paramInt)
    {
      paramDialogInterface.cancel();
      paramDialogInterface.dismiss();
      ((CommonActivity)OperationUtil.this.context).makeSelectAll(false, true);
      ((CommonActivity)OperationUtil.this.context).makeSeenToAll(true);
      OperationUtil.selectedEntities.clear();
      OperationUtil.mOperationState = Integer.valueOf(2);
      if (CountActivity.categoryActivity != null)
        CountActivity.categoryActivity.refresh();
      OperationUtil.this.duplicated.clear();
    }
  }

  private class OperationRunnable
    implements Runnable
  {
    Context context;
    OperationUtil oper;

    public OperationRunnable(Context paramContext, OperationUtil paramOperationUtil)
    {
      this.context = paramContext;
      this.oper = paramOperationUtil;
    }

    public void run()
    {
      Looper.prepare();
      OperationUtil.operationRunnableOver = false;
      this.oper.operate();
      OperationUtil.operationRunnableOver = true;
      if (SDcardChecker.mediaUpdating > 0)
        return;
      OperationUtil.this.notifyFinished();
      Looper.loop();
    }
  }

  private class PerformOperationClickListener
    implements DialogInterface.OnClickListener
  {
    OperationUtil oper;

    public PerformOperationClickListener(OperationUtil paramOperationUtil)
    {
      this.oper = paramOperationUtil;
    }

    public void onClick(DialogInterface paramDialogInterface, int paramInt)
    {
      paramDialogInterface.cancel();
      paramDialogInterface.dismiss();
      if ((OperationUtil.operatingDialog == null) || (OperationUtil.operatingDialog.isShowing()));
      do
        return;
      while ((OperationUtil.this.thread != null) && (OperationUtil.this.thread.isAlive()));
      OperationUtil.this.thread.start();
      OperationUtil.operatingDialog.show();
    }
  }
}

/* Location:           H:\360云盘\lewa_explorer_3.0\bin\FileApp_orig_dex2jar.jar
 * Qualified Name:     cn.cheln.explorer.actions.OperationUtil
 * JD-Core Version:    0.5.2
 */